<?php
/**
 * Created by PhpStorm.
 * User: Michael Ma
 * Date: 2017/4/14
 * Time: 21:09
 */

header("Content-Type: text/plain;charset=utf-8");
header("Access-Control-Allow-Origin:*");
header("Access-Control-Methods:POST,GET");

//载入user类
require_once ("classes/user.php");

//获取ID
$userId = isset($_POST['id']) ? $_POST['id'] : '';

//实例化方法
$user = new User();
$query = $user -> getAllById($userId);
$result = mysqli_fetch_assoc($query);
echo json_encode($result,JSON_UNESCAPED_UNICODE);
?>